// hots/hot/hotinfor/hotinfor.js
const app = getApp()
import { HTTP } from '../../../utils/https.js'
let http = new HTTP()
var util = require('../../../utils/util.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    curview:1,
    invite_page:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
   this.invite_page()
  },
 /**
 * 邀请成功的好友
 */
 invite_page:function(){
    var that = this
  http.request({
    url: 'mini/v1/personal/invite_page',
    success: function (res) {
      const data = res.data    
      for (var i = 0; i < data.length; i++) {
        data[i].created_at = util.timestampToTime(data[i].created_at);
      } 

      that.setData({
        invite_page:data
      })
    }
  })
  },
  /**导航点击
   * 
   */
  choosenav:function(e){
    this.setData({
      curview:e.currentTarget.dataset.cur
    })
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    return util.share()
  }
})